package n0mm4d3.RD.Rede;

import java.awt.AWTException;
import java.awt.Robot;
import java.io.DataInputStream;
import java.io.IOException;
import java.net.Socket;

/**
 * Classe que recebe e implementa as coordenadas do mouse
 * @author Maelby Muniz aka n0mm4d3
 * ADS - IFPB Campus Monteiro
 */
public class ImplementaCoordenadas {
	
	public void implementaCoordenadas(Socket socket) throws IOException, AWTException {
		
		System.out.println("Entrou - Coordenadas");
		
		DataInputStream dis = new DataInputStream(socket.getInputStream());
		
		Robot robot = new Robot();
		
		while (socket != null) {
			int x = dis.readInt();
			int y = dis.readInt();

			// Move o mouse a partir das coordenadas recebidas
			robot.mouseMove(x, y);
		}
	}
}
